#ifndef FEEDREADER_IFEEDREADER_ENGINE_INCLUDED
#define FEEDREADER_IFEEDREADER_ENGINE_INCLUDED

#include <set>
#include <string>
#include <vector>
#include <list>

using namespace std;


struct __News
{
	int	FeedID;
	int	NewsID;
		
	string 	Title;	
	string 	Description;
	string 	Author;
	string 	Url;
	
	time_t 	DateTime;
	
	set<int> Tags;
};


struct __Feed
{
	int	FeedID;
	
	string	Name;
	string	Url;
	
	time_t 	DateTime;
};


struct __Tag
{
	int 	TagID;
	string	Name;
};


class IFeedReaderEngine
{
public:
	virtual set<__Tag*> 	GetTags () = 0;
	virtual set<__Feed*>	GetFeeds () = 0;
	virtual list<__News*>	GetFeedByNumber ( int feedID , int start , int count ) = 0;
	virtual list<__News*>	GetNews  ( int page , int count ) = 0;

	virtual int             AddTag ( string name ) = 0;
	virtual int             DelTag ( int tagID ) = 0;
	
	virtual	int		AddFeed ( string name , string url ) = 0;
	virtual int		DelFeed ( int feedID ) = 0;

	virtual int		AssignTags ( int feedID , int newsID , set<int> tags ) = 0;
	virtual int		RemoveTags ( int feedID , int newsID , set<int> tags ) = 0;

	virtual list<__News*> Search ( set<int> feeds , set<int> tagsPositive , 
			set<int> tagsNegative , time_t since , time_t until ) = 0;
};

#endif
